package meconsea.life.clan.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import meconsea.life.sys.entity.AbsEntity;

import org.hibernate.annotations.Type;

@Entity
@Table(name="CLAN_USER_MAP")
@NamedQueries({
	@NamedQuery(name=ClanUserMap.CLAN_USER_FIND_CU,query="SELECT o from ClanUserMap o where o.clanId=:clanId and o.userId = :userId "),
	@NamedQuery(name=ClanUserMap.CLAN_USER_FIND_CUC,query="SELECT o from ClanUserMap o where o.clanId = :clanId and o.isCommend=:isCommend")
})
public class ClanUserMap extends AbsEntity {
	
	public final static String CLAN_USER_FIND_CU = "clan_user_find";
	public final static String CLAN_USER_FIND_CUC = "clan_user_find_cuc";
	
	@Column(name="userId")
	private String userId;
	
	@Column(name="clanId")
	private String clanId;
	
	@Column(name="loginSum")
	@Type(type="integer")
	private Integer loginSum = 0;
	
	@Column(name="subjectSum")
	@Type(type="integer")
	private Integer subjectSum = 0;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="lastLogin")
	private Date lastLogin = new Date();
	
	@Column(name="isCommend")
	@Type(type="integer")
	private Integer isCommend = 0;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getClanId() {
		return clanId;
	}

	public void setClanId(String clanId) {
		this.clanId = clanId;
	}

	public Integer getLoginSum() {
		return loginSum;
	}

	public void setLoginSum(Integer loginSum) {
		this.loginSum = loginSum;
	}

	public Integer getSubjectSum() {
		return subjectSum;
	}

	public void setSubjectSum(Integer subjectSum) {
		this.subjectSum = subjectSum;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public Integer getIsCommend() {
		return isCommend;
	}

	public void setIsCommend(Integer isCommend) {
		this.isCommend = isCommend;
	}
}
